<template>
  <div>
    <el-table :data="dizhiList" style="width: 100%">
      <el-table-column
        fixed
        prop="userid"
        label="订单号"
        width="260"
        header-align="center"
        align="center"
      />
      <el-table-column prop="name" label="姓名" width="100" />
      <el-table-column prop="city" label="城市" width="100" />
      <el-table-column prop="county" label="城市" width="100" />
      <el-table-column
        prop="addressDetail"
        label="地区"
        width="160"
        header-align="center"
        align="center"
      />

      <el-table-column
        prop="addressid"
        label="地址"
        width="270"
        header-align="center"
        align="center"
      />
      <el-table-column
        prop="tel"
        label="电话"
        width="200"
        header-align="center"
        align="center"
      />
    </el-table>
  </div>
</template>

<script setup lang='ts'>
import { reactive, ref } from "vue";
import service from "../../../utils/service";
import { ElLoading } from "element-plus";

import axios from "axios";
const loading = ref(true);
interface IDizhi {
  userid: string; //用户
  name: string;
  tel: string;
  province: string;
  city: string;
  county: string;
  addressDetail: string;
  isDefault: boolean;
  addressid: string;
}

let dizhiList = reactive<IDizhi[]>([]);
const getdingdanList = () => {
  service({
    url: "/address/list",
  }).then((res: any) => {
    if (res.data.code === "200") {
      dizhiList.length = 0;
      dizhiList.push(...res.data.data);
    }
  });
};

getdingdanList();
</script>

<style scoped>
</style>